#include <iostream>
#include <iomanip>
using namespace std;
void arrayPtr(long *p, int n) {
	cout << "In func, address of array is "
		<< p << endl;
	cout << "Accessing array using pointers" << endl;
	for (int i = 0; i < n; i++) {
		cout << " Address for index " << i << " is "
			<< p + i;
		cout << " Value is " << *(p + i) << endl;
	}
}
int main() {
	long list[5] = { 50, 60, 70, 80, 90 };
	cout << "In main, address of array is "
		<< list << endl;
	cout << endl;
	arrayPtr(list, 5);
	return 0;
}